'''
进程通信：Queue（队列）
'''
from multiprocessing import Process, Queue

def mockDownloadData(queue):
    demo_data = [11, 22, 33, 44, 55]
    for dd in demo_data:
        queue.put(dd)
    print('===>> mockDownloadData completed!')

def analysisData(queue):
    while True:
        print("==>>get queue data", queue.get())
        if queue.empty():
            break
    print('===>> analysisData completed!')

if __name__ == "__main__":
    # 创建队列
    queue = Queue()
    # 创建子进程
    process_1 = Process(target=mockDownloadData, args=(queue, ))
    process_2 = Process(target=analysisData, args=(queue, ))
    process_1.start()
    process_2.start()